/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package DTO;

public class CChiTietHoaDon extends CId{
    public CChiTietHoaDon(){
        this.soLuong = 0;
        this.giamGia = 0.0;
        this.thanhTien = 0.0;
        this.isTang = false;
        this.tientra = 0.0;
        this.giaVon = 0.0;
    }
    
    private long sanPhamId;
    private int soLuong;
    private Double dongia;
    private Double thanhTien;
    private Boolean isTang;
    private Double giamGia;//giam gia theo ty le phan % gia thanh
    private Double tienThanhToan;    
    private long hoaDonId;
    private String donVi;
    private String tenSanPham;
    private Double tientra;
    private String maSP;
    public void setMaSP(String masp){
        this.maSP = masp;
    }
    public String getMaSP(){
        return this.maSP;
    }
    private double giaVon;
    public void setGiaVon(Double giavon){
        this.giaVon = giavon;
    }
    
    public Double getGiaVon(){
        return this.giaVon;
    }
    
    public void setTienTra(Double tientra){
        this.tientra = tientra;
    }
    public Double getTienTra(){
        return this.tientra;
    }
    
    public void setTenSanPham(String tsp){
        this.tenSanPham = tsp;
    }
    public String getTenSanPham(){
        return this.tenSanPham;
    }
    public void setSoLuong(int soluong){
        this.soLuong =soluong;
    }
    public int getSoLuong(){
        return this.soLuong;
    }
    public void setDonVi(String dv){
        this.donVi = dv;
    }
    public String getDonVi(){
        return this.donVi;
    }
    public void setHoaDonId(long hoadonid){
        this.hoaDonId = hoadonid;
    }
    
    public long getHoaDonId(){
        return this.hoaDonId;
    }
    
    public void  setTienThanhToan(Double tienthanhToan){
        this.tienThanhToan = tienthanhToan;
    }
    
    public Double getTienThanhToan(){
        return this.tienThanhToan;
    }
    
    public void setGiamGia(Double giamgia){
        this.giamGia = giamgia;
    }
        
    public Double getGiamGia(){
        return this.giamGia;
    }
    public void setTang(Boolean istang){
        this.isTang = isTang;
    }
    public Boolean getTang(){
        return this.isTang;
    }
    
    public void setThanhTien(Double thanhtien){
        this.thanhTien = thanhtien;                
    }
    
    public Double getThanhTien(){
        return this.thanhTien;
    }
    
    public void setDongia(Double dongia){
        this.dongia = dongia;
    }
    public Double getDongia(){
        return this.dongia;
    }
    
    
    
    public void setSanPhamId(long id){
        this.sanPhamId = id;
    }
    
    public long getSanPhamId(){
        return this.sanPhamId;
    }
    public String toString(){
        StringBuilder sBuilder = new StringBuilder();
        sBuilder.append("{");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.id,this.getId() ));
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.don_gia,this.getDongia()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.gia_von,this.getGiaVon()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.giam_gia,this.getGiamGia()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.hoa_don_id,this.getHoaDonId()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.ma_sp,this.getMaSP()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.so_luong,this.getSoLuong()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.thanh_tien,this.getThanhTien()));        
        sBuilder.append("}");
        return sBuilder.toString();
    }
}
